-[CFString length]: message sent to deallocated instance 0x3881940 when i scroll to near the bottom

Posted by James on Stack Overflow See other posts from Stack Overflow or by James
Published on 2010-04-26T05:24:38Z Indexed on 2010/04/26 5:33 UTC
Read the original article Hit count: 601

Filed under:
|
|

Hey guys, i've got a problem debugging an iphone app that i'm attempting to write and it's got me stumped, bear with me, i'm a n00b to programming and might get some of the terminology wrong but i'll try to explain it as best as i can.

The app gets an XML doc from the a web site, parses it into an array, and then displays it in a table view, i have the parser in a separate file. The ViewDidLoad in RootViewController sends it a url, the parser goes to work and then returns an NSMutableArray.

When i run the app it works fine with small XML files (5 entries or so, and 1-3 sections), but when i use a larger one(20+ rows, over 12 sections) i get the error "-[CFString length]: message sent to deallocated instance 0x3881940" when i scroll near the bottom of the tableview, just as the last section title is about to come onto the viewable area on the screen to be precise.

if i return a static string instead of the object in my array in this method it doesn't crash, but i can use NSLog to call the array and it returns the title no problems.

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)indexPath {
    return [[returnedEvents objectAtIndex:indexPath ] objectAtIndex:0];
}

The returnedEvents array isn't released until -(void) dealloc {}

I have read a few other posts on here, and a few guides on debugging and as of yet am unable to find anything that was able to help me, i'd be more than happy to post some code up here and any more information, i'm just not sure where to start...

Thanks in advance for anyone willing to have a go at helping me out.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about iphone